package net.maxwoods.nimble.springmvc.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

@Component
public class MyApplicationListener implements org.springframework.context.ApplicationListener<ContextRefreshedEvent> {

    private static final Logger logger = LoggerFactory.getLogger(MyApplicationListener.class);

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        logger.info("===========onApplicationEvent:{}", event);
        logger.info("{}", event.getSource().getClass().getName());
        logger.info("{}", event.getClass().getName());
        event.getApplicationContext().getBeansOfType(Object.class);
    }

}
